<%@ page import="com.entity.Blog" %>
<%@ page import="com.service.BlogService" %>
<%@ page import="com.service.BlogServiceImpl" %><%--
  Created by IntelliJ IDEA.
  User: Elle
  Date: 2022/6/18
  Time: 9:08
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
//修改
    //1、获取请求的数据
    request.setCharacterEncoding("utf-8"); //post
    String id = request.getParameter("id");
    String content = request.getParameter("content");
    //2、操作
    Blog blog = new Blog(Integer.valueOf(id), null, content, null, null, null, null);
    BlogService blogService = new BlogServiceImpl();
    int ret = blogService.update(blog);
    //3、页面跳转
    if(ret>0){
        out.println("<script>alert('修改成功');location.href='doList.jsp'</script>");
    }else{
        out.println("<script>alert('修改失败');history.go(-1);</script>");
    }
%>
